package com.szrt.javaweb.oa.department.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.szrt.javaweb.oa.common.MessageDTO;
import com.szrt.javaweb.oa.department.dao.DepartmentDao;
import com.szrt.javaweb.oa.department.entity.DepartmentEntity;

@Service
public class DepartmentServiceXML {
	
	@Autowired
	private DepartmentDao dao;
	
	
	public void add(DepartmentEntity entity,Map<String,Object> map) {
		try{
			dao.add(entity);
			System.out.println("第一个Dao操作成...");
			System.out.println(20/0);
			map.put("message", MessageDTO.getSuccessMessage());
		}catch(Exception e){
			System.out.println("抛出异常了....");
			e.printStackTrace();
			map.put("message", MessageDTO.getFailureMessage());
			throw new RuntimeException(); 
		}
	}
	

}
